package com.missilike.api.domain.response;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class InternalResponse {

    @JsonProperty("errorMessage")
    private String errorMessage;

    @JsonProperty("ErrorCode")
    private int errorCode;

    @JsonProperty("body")
    private Object body;

    @JsonProperty("imSign")
    private Object imSign;

    public InternalResponse(int errorCode,String errorMessage) {
        this.errorMessage = errorMessage;
        this.errorCode = errorCode;
    }


    public static InternalResponse success() {
        return  new InternalResponse(01,"操作成功");
    }

    public static InternalResponse error() {
        return  new InternalResponse(02,"操作失败");
    }

    public InternalResponse withBody(Object body) {
        this.body = body;
        return this;
    }

    public InternalResponse withSign(Object sign) {
        this.imSign = sign;
        return this;
    }
}
